package org.summer.lawyer.controller.wx;

import cn.dev33.satoken.annotation.SaIgnore;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotEmpty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.summer.common.core.domain.R;
import org.summer.lawyer.domain.vo.legaldocument.LegalDocumentVo;
import org.summer.lawyer.service.ILegalDocumentService;

/**
 *
 */
@Tag(name = "微信小程序用户协议相关接口", description = "微信小程序用户协议相关接口")
@Slf4j
@Validated
@SaIgnore
@RestController
@RequiredArgsConstructor
@RequestMapping("/wx/document")
public class WxLegalDocumentController {

    private final ILegalDocumentService legalDocumentService;


    @Operation(description = "获取用户协议（1隐私政策，2用户服务协议）")
    @GetMapping("/{docType}")
    public R<LegalDocumentVo> getLegalDocument(@NotEmpty( message =  "协议类型不能为空") @PathVariable("docType") String docType) {
        return R.ok("", legalDocumentService.selectLegalDocumentVoByDocType(docType));
    }
}
